3.1.10 \(\int \frac {a+b \sin (c+d x^2)}{x^2} \, dx\) [10]

Optimal. Leaf size=88 \[ -\frac {a}{x}+b \sqrt {d} \sqrt {2 \pi } \cos (c) C\left (\sqrt {d} \sqrt {\frac {2}{\pi }} x\right )-b \sqrt {d} \sqrt {2 \pi } S\left (\sqrt {d} \sqrt {\frac {2}{\pi }} x\right ) \sin (c)-\frac {b \sin \left (c+d x^2\right )}{x} \]

[Out]

-a/x-b*sin(d*x^2+c)/x+b*cos(c)*FresnelC(x*d^(1/2)*2^(1/2)/Pi^(1/2))*d^(1/2)*2^(1/2)*Pi^(1/2)-b*FresnelS(x*d^(1
/2)*2^(1/2)/Pi^(1/2))*sin(c)*d^(1/2)*2^(1/2)*Pi^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.06, antiderivative size = 88, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.312, Rules used = {14, 3468, 3435, 3433, 3432} \begin {gather*} -\frac {a}{x}+\sqrt {2 \pi } b \sqrt {d} \cos (c) \text {FresnelC}\left (\sqrt {\frac {2}{\pi }} \sqrt {d} x\right )-\sqrt {2 \pi } b \sqrt {d} \sin (c) S\left (\sqrt {d} \sqrt {\frac {2}{\pi }} x\right )-\frac {b \sin \left (c+d x^2\right )}{x} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + b*Sin[c + d*x^2])/x^2,x]

[Out]

-(a/x) + b*Sqrt[d]*Sqrt[2*Pi]*Cos[c]*FresnelC[Sqrt[d]*Sqrt[2/Pi]*x] - b*Sqrt[d]*Sqrt[2*Pi]*FresnelS[Sqrt[d]*Sq
rt[2/Pi]*x]*Sin[c] - (b*Sin[c + d*x^2])/x

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 3432

Int[Sin[(d_.)*((e_.) + (f_.)*(x_))^2], x_Symbol] :> Simp[(Sqrt[Pi/2]/(f*Rt[d, 2]))*FresnelS[Sqrt[2/Pi]*Rt[d, 2
]*(e + f*x)], x] /; FreeQ[{d, e, f}, x]

Rule 3433

Int[Cos[(d_.)*((e_.) + (f_.)*(x_))^2], x_Symbol] :> Simp[(Sqrt[Pi/2]/(f*Rt[d, 2]))*FresnelC[Sqrt[2/Pi]*Rt[d, 2
]*(e + f*x)], x] /; FreeQ[{d, e, f}, x]

Rule 3435

Int[Cos[(c_) + (d_.)*((e_.) + (f_.)*(x_))^2], x_Symbol] :> Dist[Cos[c], Int[Cos[d*(e + f*x)^2], x], x] - Dist[
Sin[c], Int[Sin[d*(e + f*x)^2], x], x] /; FreeQ[{c, d, e, f}, x]

Rule 3468

Int[((e_.)*(x_))^(m_)*Sin[(c_.) + (d_.)*(x_)^(n_)], x_Symbol] :> Simp[(e*x)^(m + 1)*(Sin[c + d*x^n]/(e*(m + 1)
)), x] - Dist[d*(n/(e^n*(m + 1))), Int[(e*x)^(m + n)*Cos[c + d*x^n], x], x] /; FreeQ[{c, d, e}, x] && IGtQ[n,
0] && LtQ[m, -1]

Rubi steps

\begin {align*} \int \frac {a+b \sin \left (c+d x^2\right )}{x^2} \, dx &=\int \left (\frac {a}{x^2}+\frac {b \sin \left (c+d x^2\right )}{x^2}\right ) \, dx\\ &=-\frac {a}{x}+b \int \frac {\sin \left (c+d x^2\right )}{x^2} \, dx\\ &=-\frac {a}{x}-\frac {b \sin \left (c+d x^2\right )}{x}+(2 b d) \int \cos \left (c+d x^2\right ) \, dx\\ &=-\frac {a}{x}-\frac {b \sin \left (c+d x^2\right )}{x}+(2 b d \cos (c)) \int \cos \left (d x^2\right ) \, dx-(2 b d \sin (c)) \int \sin \left (d x^2\right ) \, dx\\ &=-\frac {a}{x}+b \sqrt {d} \sqrt {2 \pi } \cos (c) C\left (\sqrt {d} \sqrt {\frac {2}{\pi }} x\right )-b \sqrt {d} \sqrt {2 \pi } S\left (\sqrt {d} \sqrt {\frac {2}{\pi }} x\right ) \sin (c)-\frac {b \sin \left (c+d x^2\right )}{x}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.13, size = 91, normalized size = 1.03 \begin {gather*} -\frac {a}{x}-\frac {b \cos \left (d x^2\right ) \sin (c)}{x}+b \sqrt {d} \sqrt {2 \pi } \left (\cos (c) C\left (\sqrt {d} \sqrt {\frac {2}{\pi }} x\right )-S\left (\sqrt {d} \sqrt {\frac {2}{\pi }} x\right ) \sin (c)\right )-\frac {b \cos (c) \sin \left (d x^2\right )}{x} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Sin[c + d*x^2])/x^2,x]

[Out]

-(a/x) - (b*Cos[d*x^2]*Sin[c])/x + b*Sqrt[d]*Sqrt[2*Pi]*(Cos[c]*FresnelC[Sqrt[d]*Sqrt[2/Pi]*x] - FresnelS[Sqrt
[d]*Sqrt[2/Pi]*x]*Sin[c]) - (b*Cos[c]*Sin[d*x^2])/x

________________________________________________________________________________________

Maple [A]
time = 0.04, size = 66, normalized size = 0.75

method result size
default \(-\frac {a}{x}+b \left (-\frac {\sin \left (d \,x^{2}+c \right )}{x}+\sqrt {d}\, \sqrt {2}\, \sqrt {\pi }\, \left (\cos \left (c \right ) \FresnelC \left (\frac {x \sqrt {d}\, \sqrt {2}}{\sqrt {\pi }}\right )-\sin \left (c \right ) \mathrm {S}\left (\frac {x \sqrt {d}\, \sqrt {2}}{\sqrt {\pi }}\right )\right )\right )\) \(66\)
risch \(\frac {b d \sqrt {\pi }\, \erf \left (\sqrt {-i d}\, x \right ) {\mathrm e}^{i c}}{2 \sqrt {-i d}}+\frac {b d \sqrt {\pi }\, \erf \left (\sqrt {i d}\, x \right ) {\mathrm e}^{-i c}}{2 \sqrt {i d}}-\frac {a}{x}-\frac {b \sin \left (d \,x^{2}+c \right )}{x}\) \(76\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*sin(d*x^2+c))/x^2,x,method=_RETURNVERBOSE)

[Out]

-a/x+b*(-sin(d*x^2+c)/x+d^(1/2)*2^(1/2)*Pi^(1/2)*(cos(c)*FresnelC(x*d^(1/2)*2^(1/2)/Pi^(1/2))-sin(c)*FresnelS(
x*d^(1/2)*2^(1/2)/Pi^(1/2))))

________________________________________________________________________________________

Maxima [C] Result contains complex when optimal does not.
time = 0.57, size = 81, normalized size = 0.92 \begin {gather*} -\frac {\sqrt {d x^{2}} {\left ({\left (\left (i - 1\right ) \, \sqrt {2} \Gamma \left (-\frac {1}{2}, i \, d x^{2}\right ) - \left (i + 1\right ) \, \sqrt {2} \Gamma \left (-\frac {1}{2}, -i \, d x^{2}\right )\right )} \cos \left (c\right ) + {\left (\left (i + 1\right ) \, \sqrt {2} \Gamma \left (-\frac {1}{2}, i \, d x^{2}\right ) - \left (i - 1\right ) \, \sqrt {2} \Gamma \left (-\frac {1}{2}, -i \, d x^{2}\right )\right )} \sin \left (c\right )\right )} b}{8 \, x} - \frac {a}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sin(d*x^2+c))/x^2,x, algorithm="maxima")

[Out]

-1/8*sqrt(d*x^2)*(((I - 1)*sqrt(2)*gamma(-1/2, I*d*x^2) - (I + 1)*sqrt(2)*gamma(-1/2, -I*d*x^2))*cos(c) + ((I
+ 1)*sqrt(2)*gamma(-1/2, I*d*x^2) - (I - 1)*sqrt(2)*gamma(-1/2, -I*d*x^2))*sin(c))*b/x - a/x

________________________________________________________________________________________

Fricas [A]
time = 0.36, size = 78, normalized size = 0.89 \begin {gather*} \frac {\sqrt {2} \pi b x \sqrt {\frac {d}{\pi }} \cos \left (c\right ) \operatorname {C}\left (\sqrt {2} x \sqrt {\frac {d}{\pi }}\right ) - \sqrt {2} \pi b x \sqrt {\frac {d}{\pi }} \operatorname {S}\left (\sqrt {2} x \sqrt {\frac {d}{\pi }}\right ) \sin \left (c\right ) - b \sin \left (d x^{2} + c\right ) - a}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sin(d*x^2+c))/x^2,x, algorithm="fricas")

[Out]

(sqrt(2)*pi*b*x*sqrt(d/pi)*cos(c)*fresnel_cos(sqrt(2)*x*sqrt(d/pi)) - sqrt(2)*pi*b*x*sqrt(d/pi)*fresnel_sin(sq
rt(2)*x*sqrt(d/pi))*sin(c) - b*sin(d*x^2 + c) - a)/x

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {a + b \sin {\left (c + d x^{2} \right )}}{x^{2}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sin(d*x**2+c))/x**2,x)

[Out]

Integral((a + b*sin(c + d*x**2))/x**2, x)

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sin(d*x^2+c))/x^2,x, algorithm="giac")

[Out]

integrate((b*sin(d*x^2 + c) + a)/x^2, x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {a+b\,\sin \left (d\,x^2+c\right )}{x^2} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*sin(c + d*x^2))/x^2,x)

[Out]

int((a + b*sin(c + d*x^2))/x^2, x)

________________________________________________________________________________________